package com.efuture.chapterfive

/* @Description:Kotlin语言运算符重载
 * @Auther: zhaoshanshan
 * @Date: 2022/03/07/2:51 下午
 */
class Demo87(var num1:Int,var num2:Int){
    //plus 代表加运算符重载
    operator fun plus(p1:Demo87):Int{
        return (num1+p1.num1) + (num2+p1.num2)
    }

}
fun main() {
    println(Demo87(1,2)+Demo87(3,4))

}